# 导包
import unittest
from script.test_login import TestLogin
from script.test_recharge import TestRecharge
from script.test_tender import TestTender
from script.test_tender_flow import TestTenderFlow
from script.test_trust_account import TestTrustAccount

from htmltestreport import HTMLTestReport

import app

# 创建测试套件
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestLogin))
suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(TestTrustAccount))
suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(TestRecharge))
suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(TestTender))
suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(TestTenderFlow))

# 执行测试套件
# unittest.TextTestRunner().run(suite)

# 生成测试报告
report_file = app.BASE_DIR + "/report/report.html"
report = HTMLTestReport(report_file, title="P2P金融项目接口自动化测试报告666", description="V5.0。。。")
report.run(suite)
